From 06e677c9c8feb41874675a8e5cd4ccb0fa146b62 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 17 Jul 2007 14:46:43 +0000 Subject: [PATCH] * (bug 10615) Fix for transwiki import when CURL not available Was doing a POST without sending Content-Length header, which some web servers get real pissy about. Now sends a 'Content-Length: 0' header --- RELEASE-NOTES | 2 ++ includes/HttpFunctions.php | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 757614a31d..d2a4a494c6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -310,6 +310,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 1629) Stop section edit links from being shoved down by other floats * (bug 4650) Keep impossibly large/small counts off Special:Statistics * (bug 10608) PHP notice when installing with PostgreSQL +* (bug 10615) Fix for transwiki import when CURL not available + == API changes since 1.10 == diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index c528f6c0ce..249798a20b 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -63,6 +63,10 @@ class Http { # This may take 3 minutes to time out, and doesn't have local fetch capabilities $opts = array('http' => array( 'method' => $method ) ); + if( strcasecmp( $method, 'post' ) == 0 ) { + // Required for HTTP 1.0 POSTs + $opts['http']['header'] = "Content-Length: 0"; + } $ctx = stream_context_create($opts); $url_fopen = ini_set( 'allow_url_fopen', 1 ); -- 2.20.1